package com.carkeeper.user.dao;

import com.carkeeper.user.pojo.Department;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.spring.annotation.MapperScan;

import java.util.List;


public interface DepartmentMapper extends Mapper<Department> {

    //根据部门名称查询部门id
    @Select("select id from tb_department where name=#{name}")
    Department findDepartmentIdByDepartmentName(@Param("name") String name);

    //查询部门名称的集合
    @Select("select name from tb_department")
    List<String> findDepartmentName();

    //查询所有部门
    @Select("select code,name from tb_department where delet != 1")
    List<Department> findAll();

}
